package com.hdu.point_offer;

public class lcr165 {
    class Solution {
        public int crackNumber(int ciphertext) {
            return f(String.valueOf(ciphertext), 0);
        }

        int f(String s, int index)
        {
            if (index == s.length()) return 1;
            int ans = 0;
            ans += f(s, index + 1);
            if (index + 1 < s.length())
            {
                String curS = s.substring(index, index + 2);
                if (curS.compareTo("10") >= 0 && curS.compareTo("25") <= 0)
                {
                    ans += f(s, index + 2);
                }
            }
            return ans;
        }
    }
}
